package com.oocl.util;


import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

public class FileUtil {
	
     public static void  toFile(InputStream in ,String path){
    	 try {
			OutputStream out = new FileOutputStream(path);
		    byte[] bs = new byte[in.available()];
		    in.read(bs);
		    out.write(bs);
           out.close();		    
		}catch (IOException e) {
			e.printStackTrace();
		} 
     } 
     
     
     public static void  toFile(byte[] bs ,String path){
    	 try {
			 OutputStream out = new FileOutputStream(path);
		     out.write(bs);
             out.close();		    
		}catch (IOException e) {
			e.printStackTrace();
		} 
     } 
}
